<?php

namespace app\index\controller\home;

use app\index\service\CityTreeService;
use ShidianUtil\Thinkphp\Response\ApiResponse;
use think\APP;

/**
 * CityTree 控制器
 * Class CityTree
 * @package app\home\controller
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037509
 */
class CityTree
{
    // service
    private CityTreeService $service;

    public function __construct(CityTreeService $cityTreeService)
    {
        $this->service = $cityTreeService;
    }

    /**
     * 列表
     * @return ApiResponse
     * @url /home/city_tree/index
     */
    public function index(): ApiResponse
    {
        return ApiResponse::success($this->service->index());
    }

}
